<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>DetectHiddenWindows</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
</head>
<body>

<h1>DetectHiddenWindows</h1>

<p>Determines whether invisible windows are &quot;seen&quot; by the script.</p>

<pre class="Syntax">DetectHiddenWindows, On|Off</pre>
<h3>Parameters</h3>
<dl>

  <dt>On|Off</dt>
  <dd><p><strong>On</strong>: Hidden windows are detected.</p>
    <p><strong>Off</strong>: This is the default. Hidden windows are not detected, except by the <a href="WinShow.htm">WinShow</a> command.</p></dd>

</dl>

<h3>Remarks</h3>
<p>Turning on DetectHiddenWindows can make scripting harder in some cases since some hidden system windows might accidentally match the title or text of another window you're trying to work with. So most scripts should leave this setting turned off. However, turning it on may be useful if you wish to work with hidden windows directly without first using <a href="WinShow.htm">WinShow</a> to unhide them.</p>
<p>All windowing commands except <a href="WinShow.htm">WinShow</a> are affected by this setting, including <a href="WinActivate.htm">WinActivate</a>, <a href="WinActive.htm">IfWinActive</a>, <a href="WinWait.htm">WinWait</a>, <a href="WinExist.htm">IfWinExist</a>. By contrast, <a href="WinShow.htm">WinShow</a> will always unhide a hidden window even if hidden windows are not being detected.</p>
<p>Turning on DetectHiddenWindows is not necessary when accessing a control or child window via the <a href="../misc/WinTitle.htm#ahk_id">ahk_id method</a> or as the <a href="../misc/WinTitle.htm#LastFoundWindow">last-found-window</a>. It is also not necessary when accessing GUI windows via <code><a href="Gui.htm#LastFound">Gui +LastFound</a></code>.</p>
<p>The built-in variable <strong>A_DetectHiddenWindows</strong> contains the current setting (On or Off).</p>
<p>Every newly launched <a href="../misc/Threads.htm">thread</a> (such as a <a href="../Hotkeys.htm">hotkey</a>, <a href="Menu.htm">custom menu item</a>, or <a href="SetTimer.htm">timed</a> subroutine) starts off fresh with the default setting for this command. That default may be changed by using this command in the auto-execute section (top part of the script).</p>
<h3>Related</h3>
<p><a href="DetectHiddenText.htm">DetectHiddenText</a></p>
<h3>Example</h3>
<pre class="NoIndent">DetectHiddenWindows, on</pre>

</body>
</html>
